<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>

<% Class.forName("oracle.jdbc.OracleDriver"); %>


<html>
<head>
<title>Search Results</title>
</head>


<body background="bg.jpg">

<center>
<h2 align = "center"><a href="home4.jsp" style="text-decoration:blink;"><b>Home</b></a>&nbsp;&nbsp;&nbsp;<a href="add4.jsp" style="text-decoration:blink;"><b>Add a product</b></a>&nbsp;&nbsp;&nbsp;<a href="hello.jsp" style="text-decoration:blink;"><b>Inventory</b></a>&nbsp;&nbsp;&nbsp;<a href="search4.jsp" style="text-decoration:blink;">search</a>&nbsp;&nbsp;&nbsp;<a href="abt us.jsp" style="text-decoration:blink;"><b>About Us</b></a></h2>

<h2 align = "center"> <b> Search Results </b> </h2>



 <% 
	String strid="unknown";  int id ;
	String pid = request.getParameter("prod_name");
	

            Connection connection = DriverManager.getConnection(
                "jdbc:oracle:thin:@localhost:1521:xe", "SEPROJECT", "123456");

            Statement statement = connection.createStatement() ;
            ResultSet resultset = statement.executeQuery("select * from PRODUCT where name='" + pid + "'") ; 
	
    %>

 <TABLE BORDER="1">
            <TR>
                <TH>ID</TH>
                <TH>Category</TH>
                <TH>Name</TH>
                <TH>Description</TH>
                <TH>Stock Qty</TH>
	 <TH>Stock Qty</TH>
            </TR>
            <% while(resultset.next()){ %>
            <TR>
                <TD> <%= resultset.getString(1) %></td>
                <TD> <%= resultset.getString(2) %></TD>
                <TD> <%= resultset.getString(3) %></TD>
	<TD> <%= resultset.getString(4) %></TD>
	<TD> <%= resultset.getString(5) %></TD>
	<TD> <%= resultset.getString(6) %></TD>
               
            </TR>

	 <% } %>
        </TABLE>

	
	
</body>
</html>